#include "Flashbox4LogoView.h"
#include  <aknviewappui.h>
#include  <avkon.hrh>	 
#include "Flashbox4.hrh"

CFlashbox4LogoView::~CFlashbox4LogoView()
{
	if (m_pLogoContainer != NULL)
	{
		delete m_pLogoContainer;
		m_pLogoContainer = NULL;
	}
}

void CFlashbox4LogoView::ConstructL()
{
	BaseConstructL();
	m_pLogoContainer = NULL;

}

void CFlashbox4LogoView::DoActivateL(const TVwsViewId& /*aPrevViewId*/,
		TUid /*aCustomMessageId*/, const TDesC8& /*aCustomMessage*/)
{
	//激活Logo界面时，初始化Logo容器！
	if (m_pLogoContainer == NULL)
	{
		m_pLogoContainer = new (ELeave) CFlashbox4LogoContainer();
	//	CleanupStack::PushL(m_pLogoContainer);
		m_pLogoContainer->ConstructL(ClientRect());
		m_pLogoContainer->SetExtentToWholeScreen();
		m_pLogoContainer->SetMopParent(this);
	//	CleanupStack::Pop();
		AppUi()->AddToStackL(*this, m_pLogoContainer);
	}
}

void CFlashbox4LogoView::DoDeactivate()
{
	if (m_pLogoContainer != NULL)
	{
		AppUi()->RemoveFromViewStack(*this, m_pLogoContainer);
		delete m_pLogoContainer;
		m_pLogoContainer = NULL;
	}
}

TUid CFlashbox4LogoView::Id() const
{
	return TUid::Uid(ELogoViewId);
}
/*
 void CFlashbox4LogoView::HandleCommandL(TInt aCommand)
 {
 return;
 }
 */
void CFlashbox4LogoView::HandleClientRectChange()
{
	if(m_pLogoContainer != NULL)
	{
		m_pLogoContainer->SetExtentToWholeScreen();
	}
}
